/*
** Lua binding: tclass
** Generated automatically by tolua++-1.0.92 on 05/25/16 17:21:17.
*/

#ifndef __cplusplus
#include "stdlib.h"
#endif
#include "string.h"

#include "tolua++.h"

/* Exported function */
extern "C" __declspec(dllexport) int  tolua_tclass_open (lua_State* tolua_S);

#include "tclass.h"

/* function to release collected object via destructor */
#ifdef __cplusplus

static int tolua_collect_CMessage (lua_State* tolua_S)
{
 CMessage* self = (CMessage*) tolua_tousertype(tolua_S,1,0);
	delete self;
	return 0;
}

static int tolua_collect_CNumber (lua_State* tolua_S)
{
 CNumber* self = (CNumber*) tolua_tousertype(tolua_S,1,0);
	delete self;
	return 0;
}
#endif


/* function to register type */
static void tolua_reg_types (lua_State* tolua_S)
{
 tolua_usertype(tolua_S,"CMessage");
 tolua_usertype(tolua_S,"CNumber");
}

/* method: new of class  CNumber */
#ifndef TOLUA_DISABLE_tolua_tclass_CNumber_new00
static int tolua_tclass_CNumber_new00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"CNumber",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   CNumber* tolua_ret = (CNumber*)  new CNumber();
   tolua_pushusertype(tolua_S,(void*)tolua_ret,"CNumber");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: new_local of class  CNumber */
#ifndef TOLUA_DISABLE_tolua_tclass_CNumber_new00_local
static int tolua_tclass_CNumber_new00_local(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"CNumber",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   CNumber* tolua_ret = (CNumber*)  new CNumber();
   tolua_pushusertype_and_takeownership(tolua_S,(void *)tolua_ret,"CNumber");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: delete of class  CNumber */
#ifndef TOLUA_DISABLE_tolua_tclass_CNumber_delete00
static int tolua_tclass_CNumber_delete00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"CNumber",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  CNumber* self = (CNumber*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'delete'",NULL);
#endif
  delete self;
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'delete'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: new of class  CNumber */
#ifndef TOLUA_DISABLE_tolua_tclass_CNumber_new01
static int tolua_tclass_CNumber_new01(lua_State* tolua_S)
{
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"CNumber",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
 {
  int num = ((int)  tolua_tonumber(tolua_S,2,0));
  {
   CNumber* tolua_ret = (CNumber*)  new CNumber(num);
   tolua_pushusertype(tolua_S,(void*)tolua_ret,"CNumber");
  }
 }
 return 1;
tolua_lerror:
 return tolua_tclass_CNumber_new00(tolua_S);
}
#endif //#ifndef TOLUA_DISABLE

/* method: new_local of class  CNumber */
#ifndef TOLUA_DISABLE_tolua_tclass_CNumber_new01_local
static int tolua_tclass_CNumber_new01_local(lua_State* tolua_S)
{
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"CNumber",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
 {
  int num = ((int)  tolua_tonumber(tolua_S,2,0));
  {
   CNumber* tolua_ret = (CNumber*)  new CNumber(num);
   tolua_pushusertype_and_takeownership(tolua_S,(void *)tolua_ret,"CNumber");
  }
 }
 return 1;
tolua_lerror:
 return tolua_tclass_CNumber_new00_local(tolua_S);
}
#endif //#ifndef TOLUA_DISABLE

/* method: SetNumber of class  CNumber */
#ifndef TOLUA_DISABLE_tolua_tclass_CNumber_SetNumber00
static int tolua_tclass_CNumber_SetNumber00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"CNumber",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  CNumber* self = (CNumber*)  tolua_tousertype(tolua_S,1,0);
  int num = ((int)  tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetNumber'",NULL);
#endif
  {
   self->SetNumber(num);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'SetNumber'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: GetNumber of class  CNumber */
#ifndef TOLUA_DISABLE_tolua_tclass_CNumber_GetNumber00
static int tolua_tclass_CNumber_GetNumber00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"CNumber",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  CNumber* self = (CNumber*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetNumber'",NULL);
#endif
  {
   int tolua_ret = (int)  self->GetNumber();
   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'GetNumber'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: Add of class  CNumber */
#ifndef TOLUA_DISABLE_tolua_tclass_CNumber_Add00
static int tolua_tclass_CNumber_Add00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"CNumber",0,&tolua_err) ||
     !tolua_isnumber(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  CNumber* self = (CNumber*)  tolua_tousertype(tolua_S,1,0);
  int num = ((int)  tolua_tonumber(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'Add'",NULL);
#endif
  {
   int tolua_ret = (int)  self->Add(num);
   tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'Add'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: new of class  CMessage */
#ifndef TOLUA_DISABLE_tolua_tclass_CMessage_new00
static int tolua_tclass_CMessage_new00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"CMessage",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   CMessage* tolua_ret = (CMessage*)  new CMessage();
   tolua_pushusertype(tolua_S,(void*)tolua_ret,"CMessage");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: new_local of class  CMessage */
#ifndef TOLUA_DISABLE_tolua_tclass_CMessage_new00_local
static int tolua_tclass_CMessage_new00_local(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertable(tolua_S,1,"CMessage",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  {
   CMessage* tolua_ret = (CMessage*)  new CMessage();
   tolua_pushusertype_and_takeownership(tolua_S,(void *)tolua_ret,"CMessage");
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: delete of class  CMessage */
#ifndef TOLUA_DISABLE_tolua_tclass_CMessage_delete00
static int tolua_tclass_CMessage_delete00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"CMessage",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  CMessage* self = (CMessage*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'delete'",NULL);
#endif
  delete self;
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'delete'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: SetMessage of class  CMessage */
#ifndef TOLUA_DISABLE_tolua_tclass_CMessage_SetMessage00
static int tolua_tclass_CMessage_SetMessage00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"CMessage",0,&tolua_err) ||
     !tolua_isstring(tolua_S,2,0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,3,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  CMessage* self = (CMessage*)  tolua_tousertype(tolua_S,1,0);
  char* msg = ((char*)  tolua_tostring(tolua_S,2,0));
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'SetMessage'",NULL);
#endif
  {
   self->SetMessage(msg);
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'SetMessage'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: GetMessage of class  CMessage */
#ifndef TOLUA_DISABLE_tolua_tclass_CMessage_GetMessage00
static int tolua_tclass_CMessage_GetMessage00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"CMessage",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  CMessage* self = (CMessage*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'GetMessage'",NULL);
#endif
  {
   char* tolua_ret = (char*)  self->GetMessage();
   tolua_pushstring(tolua_S,(const char*)tolua_ret);
  }
 }
 return 1;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'GetMessage'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* method: ShowMessage of class  CMessage */
#ifndef TOLUA_DISABLE_tolua_tclass_CMessage_ShowMessage00
static int tolua_tclass_CMessage_ShowMessage00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
 tolua_Error tolua_err;
 if (
     !tolua_isusertype(tolua_S,1,"CMessage",0,&tolua_err) ||
     !tolua_isnoobj(tolua_S,2,&tolua_err)
 )
  goto tolua_lerror;
 else
#endif
 {
  CMessage* self = (CMessage*)  tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
  if (!self) tolua_error(tolua_S,"invalid 'self' in function 'ShowMessage'",NULL);
#endif
  {
   self->ShowMessage();
  }
 }
 return 0;
#ifndef TOLUA_RELEASE
 tolua_lerror:
 tolua_error(tolua_S,"#ferror in function 'ShowMessage'.",&tolua_err);
 return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE

/* Open function */
int tolua_tclass_open (lua_State* tolua_S)
{
 tolua_open(tolua_S);
 tolua_reg_types(tolua_S);
 tolua_module(tolua_S,NULL,0);
 tolua_beginmodule(tolua_S,NULL);
  #ifdef __cplusplus
  tolua_cclass(tolua_S,"CNumber","CNumber","",tolua_collect_CNumber);
  #else
  tolua_cclass(tolua_S,"CNumber","CNumber","",NULL);
  #endif
  tolua_beginmodule(tolua_S,"CNumber");
   tolua_function(tolua_S,"new",tolua_tclass_CNumber_new00);
   tolua_function(tolua_S,"new_local",tolua_tclass_CNumber_new00_local);
   tolua_function(tolua_S,".call",tolua_tclass_CNumber_new00_local);
   tolua_function(tolua_S,"delete",tolua_tclass_CNumber_delete00);
   tolua_function(tolua_S,"new",tolua_tclass_CNumber_new01);
   tolua_function(tolua_S,"new_local",tolua_tclass_CNumber_new01_local);
   tolua_function(tolua_S,".call",tolua_tclass_CNumber_new01_local);
   tolua_function(tolua_S,"SetNumber",tolua_tclass_CNumber_SetNumber00);
   tolua_function(tolua_S,"GetNumber",tolua_tclass_CNumber_GetNumber00);
   tolua_function(tolua_S,"Add",tolua_tclass_CNumber_Add00);
  tolua_endmodule(tolua_S);
  #ifdef __cplusplus
  tolua_cclass(tolua_S,"CMessage","CMessage","",tolua_collect_CMessage);
  #else
  tolua_cclass(tolua_S,"CMessage","CMessage","",NULL);
  #endif
  tolua_beginmodule(tolua_S,"CMessage");
   tolua_function(tolua_S,"new",tolua_tclass_CMessage_new00);
   tolua_function(tolua_S,"new_local",tolua_tclass_CMessage_new00_local);
   tolua_function(tolua_S,".call",tolua_tclass_CMessage_new00_local);
   tolua_function(tolua_S,"delete",tolua_tclass_CMessage_delete00);
   tolua_function(tolua_S,"SetMessage",tolua_tclass_CMessage_SetMessage00);
   tolua_function(tolua_S,"GetMessage",tolua_tclass_CMessage_GetMessage00);
   tolua_function(tolua_S,"ShowMessage",tolua_tclass_CMessage_ShowMessage00);
  tolua_endmodule(tolua_S);
 tolua_endmodule(tolua_S);
 return 1;
}


#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
 int luaopen_tclass (lua_State* tolua_S) {
 return tolua_tclass_open(tolua_S);
};
#endif

